﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Aker.DevTeam;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using Extensions;

namespace Aker
{
    public partial class Kisaltmalar : XForm
    {
        public Kisaltmalar()
        {
            InitializeComponent();
        }

        private void gv_CellValueChanged(object sender, CellValueChangedEventArgs e)
        {
            gv.EndEditing();
            Data.TAM.HammaddeTableAdapter.Update(gv.GetDataRow(e.RowHandle));
        }

        private void Users_Load(object sender, EventArgs e)
        {
            Data.TAM.HammaddeTableAdapter.Fill(Data.DB.Hammadde);
            gv.Init(Data.DB.Hammadde);            
            gv.MakeEditable("HammaddeId");
            
            gv.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom;
            
            this.Text = Language.Constructions.Construction;
            if (AppSession.Language == "TR")
                gv.SetCaptions("HammaddeId:#", "Kisaltma:Kısaltma", "Aciklama:Açıklama");            
            else
                gv.SetCaptions("HammaddeId:#", "Kisaltma:Abbreviation", "Aciklama:Description");

            gv.OptionsView.ShowViewCaption = false;
            gv.BestFitColumns();
        }
    }
}
